home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: ZapFiles.thor 0.5 (16.9.94)
- **
- ** ZapFiles.thor - Script that creates sysop script commands for zapping
- ** selected files in the filedatabase window.
- ** Will only work on ABBS/MBBS systems.
- ** Author: Petter Nilsen
- **
- */
-
- options results
-
- EVE_DOCOMMAND = 11
-
- p = ' ' || address() || ' ' || show('P',,)
- thorport = pos(' THOR.',p)
-
- if thorport > 0 then thorport = word(substr(p,thorport+1),1)
- else
- do
- say 'No THOR port found!'
- exit 10
- end
- address(thorport)
-
- if ~show('p', 'BBSREAD') then do
- address command
- "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
- "WaitForPort BBSREAD"
- end
-
- address(thorport)
-
- CURRENTBBS stem CURRENT
- if(rc ~= 0) then
- do
- REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- bbs = CURRENT.BBSNAME
-
- GETFILELIST outstem LIST
- if(rc ~= 0) then
- do
- if(rc = 5) then REQUESTNOTIFY TEXT '"Filedatabase window not open."' BT '"_Ok"'
- if(rc = 6) then REQUESTNOTIFY TEXT '"No files selected."' BT '"_Ok"'
- if(rc = 30) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
- exit
- end
-
- address(BBSREAD)
-
- do i=1 to LIST.COUNT
- drop EVENT.
-
- EVENT.COMMANDSTRING = '! zap '||LIST.FILENAME.i||' y y'
-
- WRITEBREVENT bbsname '"'bbs'"' event EVE_DOCOMMAND stem EVENT
- if(rc ~= 0) then
- do
- address(thorport)
- REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
- exit
- end
- end
- exit
-